<template>
  <div>
    <p>Didi</p>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  name: "Didi",
  mounted() {
    //一般在挂载后就订阅
    PubSub.subscribe("count", (_, count) => {
      console.log(count);
      this.count = count;
    });
  },
};
</script>

<style></style>
